/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package by.vdl.websort.server.dao.rowmapper;

import by.vdl.websort.server.entity.SortedTableDTO;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author zeor
 */
public class SortedTableRowMapper implements RowMapper<SortedTableDTO>{

    public SortedTableDTO mapRow(ResultSet rs, int i) throws SQLException {
        SortedTableDTO sortedTableDTO = new SortedTableDTO();
        sortedTableDTO.setId(rs.getLong("id"));
        sortedTableDTO.setCategoryId(rs.getLong("category_id"));
        sortedTableDTO.setItemId(rs.getLong("item_id"));
        sortedTableDTO.setUserPassStudyId(rs.getLong("user_pass_study_id"));
        
        return sortedTableDTO;
    }
    
}
